<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <div>购物车页面</div>
</body>
</html>
    <style>
    </style>
</head>
<body>
    <select id="tt" onchange="checkNum()"style="text-align:center;text-align-last:center;padding-left:5px; margin:-0.6rem 0;">
        <option value="5">请选择您的选项</option>
        <option value="5">2</option>
        <option value="5">13</option>
        <option value="5">14</option>
        <option value="5">221</option>
        <option value="5">133</option>
    </select>
</body>
</html>
<script>
    function checkNum() {
        var a = document.getElementById("tt");
        var selIndex = a.selectedIndex;
        console.log(a.options[selIndex].value);
         
        console.log(a.options[selIndex].text);
        
    }
</script>
